package com.allwees.bs.module.mms.service.impl;

import com.allwees.bs.module.base.service.impl.BoServiceImpl;
import com.allwees.bs.module.mms.dao.StoreDao;
import com.allwees.bs.module.mms.entity.RetailerApply;
import com.allwees.bs.module.mms.entity.Store;
import com.allwees.bs.module.mms.service.StoreService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class StoreServiceImpl extends BoServiceImpl<StoreDao, Store> implements StoreService {

    @Resource
    private StoreDao storeDao;

    @Override
    public Store selectByRetailerUuid(String retailerUuid) {
        return storeDao.selectByRetailerUuid(retailerUuid);
    }

    @Override
    public void create(String branchUuid, RetailerApply apply) {
        Store store = new Store();
        store.setName(apply.getStoreName());
        store.setMerchantType(apply.getMerchantType());
        store.setCategoryNo(apply.getCategoryNo());
        store.setRetailerUuid(branchUuid);
        save(store);
    }
}
